#include <inctypes.h>
#include <incctrls.h>

/*********************************************************************************
* 
* krl_memncpy - 内核 memncpy
* 
* DESCRIPTION
*/

void * krl_memncpy
    (
    void *       dest, 
    const void * src, 
    uint_t       n
    )
    {
    uint_t i;
    u8_t * _s = (u8_t *) src;
    u8_t * _d = (u8_t *) dest;

    for(i = 0; i < n; i++)
        {
        _d[i] = _s[i];
        }

    return dest;
    }

/*********************************************************************************
* 
* krl_memset - 内核 memset
* 
* DESCRIPTION
*/

void * krl_memset
    (
    void * s,
    char_t ch,
    size_t n
    )
    {
    uint_t i;
    u8_t * _p = (u8_t *) s;

    for(i = 0; i < n; i++)
        {
        _p[i] = ch;
        }

    return s;
    }


/*********************************************************************************
* 
* krl_system_die - 内核 失败
* 
* DESCRIPTION
*/

void krl_system_die
    (
    char_t * errmsg
    )
    {
    hal_system_is_die (errmsg);
    return;
    }